<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JSTest</title>
</head>
<body>

</body>

<script>
    var a = 10;
    alert(a);

   function fun() {
        var b = 20;
    }
    alert(b);
</script>

</html>